package com.cloudwise.monitoring_system.service.clickhouseService.impl;

import com.cloudwise.monitoring_system.annotation.DS;
import com.cloudwise.monitoring_system.dao.clickhouseDao.CkMonitorValueDao;
import com.cloudwise.monitoring_system.entity.MonitorValue;
import com.cloudwise.monitoring_system.service.clickhouseService.CkMonitorValueService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Reisen
 * @description:ck service实现类
 * @date 2021/5/31 16:02
 */

@Service("ckMonitorValueService")
public class CkMonitorValueServiceImpl implements CkMonitorValueService {
    @Resource
    private CkMonitorValueDao ckMonitorValueDao;

    /**
     * 查询所有监控项数据
     * @param monitorValue
     * @return
     */
    @Override
    @DS("db2")
    public List<MonitorValue> ckQueryAll(MonitorValue monitorValue) {
        return ckMonitorValueDao.ckQueryAll(monitorValue);
    }

    /**
     * 新增监控项数据
     * @param monitorValue
     * @return
     */
    @Override
    @DS("db2")
    public MonitorValue insert(MonitorValue monitorValue) {
        this.ckMonitorValueDao.insert(monitorValue);
        return monitorValue;
    }
}


